<%-- 
    Document   : addlokasi
    Created on : Jul 31, 2012, 9:58:57 PM
    Author     : MiChi
--%>

<%@page import="additional.Help"%>
<%@page import="dao.KaryawanDAOImpl"%>
<%@page import="entity.Karyawan"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="check_session.jsp" />
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add Alokasi</title>

        <link href="../style/style.css" rel="stylesheet" type="text/css" />

        <script src="../javascript/validasi_data.js"></script>
        <script type="text/javascript">
            function cekData(form) {
                pesan = "PERINGATAN";
                hasil = true;
                
                if(!cekText(form.txtidkaryawan)){
                    pesan += "\nID Karyawan Kosong";
                    hasil = false;
                } else {
                    if(!positif(form.txtidkaryawan)) {
                        pesan += "\nFormat ID Karyawan Harus Angka!";
                        hasil = false;
                    }
                }
                
                if(!cekText(form.txtidpekerjaan)){
                    pesan += "\nID Pekerjaan Kosong";
                    hasil = false;
                } else{
                    if(!positif(form.txtidpekerjaan)) {
                        pesan += "\nFormat ID Pekerjaan Harus Angka!";
                        hasil = false;
                    }
                }
 
                if(!hasil) {
                    alert(pesan);
                }
            
                return hasil;
            }
            
            function resetForm(form){
                resetField(form.txtidkaryawan);
                resetField(form.txtidpekerjaan);
            }
        </script>
    </head>

    <body>
        <div id="central">

            <div id="menuatas">
                <marquee>
                    <h3> Welcome </h3>
                </marquee>
            </div>
            
            <div id="header">
                <% 
                    if(request.getSession().getAttribute("user") == null) {
                        out.write("<a href='/TR_Persistance_Alokasi_Karyawan/Logout'>LogOut</a>");
                    } else {
                        out.write("<a href='/TR_Persistance_Alokasi_Karyawan/login.jsp'>LogIn</a>");
                    }
                %> 
            </div>

            <ul id="navlist">
                <li><a id="n1" href="Home.jsp"><span>Home</span></a></li>
                <li><a id="n2" href="view_karyawan.jsp"><span>Karyawan</span></a></li>
                <li><a id="n3" href="view_pekerjaan.jsp"><span>Pekerjaan</span></a></li>
                <li><a id="n4" href="view_alokasi.jsp"><span>Alokasi Pekerjaan</span></a></li>                               
                <li><a id="n5" href="about.jsp"><span>About</span></a></li>                               
            </ul>

            <div id="content">                
                <div id="rightside">
                    <h1>Tambah Data Alokasi</h1>

                    <hr><br>
                    <form method="post" action="/TR_Persistance_Alokasi_Karyawan/TambahAlokasiKaryawan" onsubmit="return cekData(this)">
                        <table border="0">
                            <tr>
                                <td>Id Karyawan</td>
                                <td>:</td>
                                <td>
                                    <input type="text" name="txtidkaryawan"  />
                                </td>
                            </tr>

                            <tr>
                                <td>Id Pekerjaan</td>
                                <td>:</td>
                                <td>
                                    <input type="text" name="txtidpekerjaan"  />
                                </td>

                            </tr>

                            <tr>
                                <td colspan="3" align="center">
                                    <input type="submit" value="Tambah" size="15" />
                                    &nbsp;
                                    &nbsp;
                                    <input type="button" value="Reset" size="15" onclick="resetForm(this.form)" />
                                </td>
                            </tr>                            
                        </table>
                    </form>
                </div>

                <div id="footer">
                    <p>&COPY; copyright TR PERSISTENCE</p>
                </div>
            </div>
        </div>
    </body>
</html>

